import {Grid} from "@taroify/core";
import {PhoneOutlined, Scan} from "@taroify/icons";
import {View} from "@tarojs/components";

import './index.scss'
import Taro from "@tarojs/taro";

export default function BannerGrid() {

  const scanCode = () => {
    Taro.scanCode({
      success: (res) => {
        console.log(res)
      }
    })
  }

  return (
    <View className="banner-grid">
      {/*// 默认显示2条*/}
      <Grid columns={2}>
        <Grid.Item icon={<Scan/>} text="扫码点餐" onClick={scanCode}>
        </Grid.Item>
        <Grid.Item icon={<PhoneOutlined/>} text="预定点餐">
        </Grid.Item>
      </Grid>
    </View>
  )
}
